#ifndef HTMLFOREACH_H
#define HTMLFOREACH_H

#include "namespace.h"

class Parameter;
class Body;
class Template;

class HtmlForeach : public Namespace
{
public:
    HtmlForeach(Parameter* var, Parameter* index, Node* expr, Body* body, const YYLTYPE& loc);

    Parameter* variable() const { return m_var; }
    Parameter* index() const { return m_index; }
    Node* expr() const { return m_expr; }
    Body* body() const { return m_body; }

    bool hasIndex() const { return m_index != 0; }

    Template* bodyTemplate() const { return m_bodyTemplate; }
    void setBodyTemplate( Template* t );

    virtual Node* getEntry( const QString& name );
    virtual void resolveAll();

private:
    Parameter* m_var;
    Parameter* m_index;
    Node* m_expr;
    Body* m_body;
    Template* m_bodyTemplate;
};

#endif // HTMLFOREACH_H
